import request from '@/utils/request'
// 获取试卷信息所有数据接口
export const getExamPaperList = params => {
  return request({
    url: '/exam/paper',
    method: 'get',
    params
  })
}
// 获取所有题目接口
export const getQuestionList = params => {
  return request({
    url: '/exam/question',
    method: 'get',
    params
  })
}
// 获取学科列表
export const getSubjectList = () => {
  return request({
    url: '/subject/tree',
    method: 'get'

  })
}
// 查看试卷
export const getlook = id => {
  return request({
    url: `/exam/paper/${id}`,
    method: 'get'
  })
}

// 新增试卷
export const getEdit = data => {
  return request({
    url: '/exam/paper',
    method: 'post',
    data
  })
}
// 修改上架启用状态
export const updateStatus = (id, status) => {
  return request({
    url: `/exam/paper/${id}/${status}`,
    method: 'get'
  })
}
// 删除试卷
export const delPaper = id => {
  return request({
    url: `/exam/paper/${id}`,
    method: 'DELETE'
  })
}
// 查看单个试卷详细信息
export const lookRow = id => {
  return request({
    url: `/exam/paper/${id}`,
    method: 'get'
  })
}
// 修改试卷
export const updatePaperList = data => {
  return request({
    url: `/exam/paper/${data.id}`,
    method: 'put',
    data
  })
}
